def action_die(monster, game):
    from wormbane.engine.save_game import remove_save_dir

    if monster is game.hero:
        try:
            remove_save_dir()
        except OSError:
            pass
        game.quit = True
        game.quit_message = 'You die...'
        return

    game.write(monster, 'dies')
    for item in monster.create_treasure():
        item.move_to(monster.env)
    corpse = monster.create_corpse()
    if corpse:
        corpse.move_to(monster.env)
    monster.move_inv_to(monster.env)
    monster.move_to(None)
